<script>
	export default {
		onLaunch: function() {},
		onShow: function() {
			this.setEnv('pro');
			// this.setEnv('dev');
			if(!uni.getStorageSync('token')){
				uni.redirectTo({
					url:'/pages/login/login'
				})
			}
		},
		onHide: function() {},
		globalData: {
			BASE_URL: '',
			BASE_IMG_URL: '',
			BASE_UPLOAD_URL: ''
		},
		methods: {
			//设置开发环境 //开发环境：dev,生产环境：pro,测试环境：'test'
			setEnv(env) {
				this.globalData.env = env;
				if (env == 'dev') {
					let baseUrl = 'http://120.24.54.28:8085/jeecg-boot/';
					// let baseUrl = 'http://192.168.2.168:8087/jeecg-boot/';
					this.globalData.BASE_URL = baseUrl;
					this.globalData.BASE_IMG_URL = baseUrl + 'sys/common/static/';
					this.globalData.BASE_UPLOAD_URL = baseUrl + 'sys/common/upload';
				} else if (env == 'test') {
					this.globalData.BASE_URL = 'http://120.79.152.100:85/jeecg-boot/'
					this.globalData.BASE_IMG_URL = 'http://120.79.152.100:85/jeecg-boot/sys/common/static/'
					this.globalData.BASE_UPLOAD_URL = 'http://120.79.152.100:85/jeecg-boot/sys/common/upload'
				} else if (env == 'pro') {
					this.globalData.BASE_URL = 'https://admin.yongshantuan.cn/jeecg-boot/'
					this.globalData.BASE_IMG_URL = 'https://admin.yongshantuan.cn/jeecg-boot/sys/common/static/'
					this.globalData.BASE_UPLOAD_URL = 'https://admin.yongshantuan.cn/jeecg-boot/sys/common/upload'
				}
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
	view,
	radio,
	textarea,
	input {
		box-sizing: border-box;
	}

	.commenButton {
		width: 100%;
		background-color: #F1B825;
		color: #fff;
		font-size: 32rpx;
		line-height: 1.5;
		padding: 20rpx;
		border-radius: 200rpx;
		text-align: center;
	}

	.litterBox {
		padding: 0 40rpx;
		overflow: auto;
		margin-top: 10rpx;
	}

	.u-toast {
		/* width: 90% !important; */
		max-width: 100% !important;
		box-shadow: 0 0 5px #eee;
		border: 1px solid #eee
	}

	@import "uview-ui/index.scss";
</style>
